'use client'
import React, {useMemo} from "react";
import "@/styles/globals.css";
import {usePathname} from "next/navigation";
import loadable from "@loadable/component";

const RootLayout = loadable(() => import("@/components/Layout/RootLayout"));

export default function Layout(props: { children: React.ReactNode }) {
    const {children} = props;

    const path = usePathname();

    const isHome = useMemo(() => {
        return path === "/";
    }, [path]);

    return (
        <html lang="en">
        <head>
            <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        </head>
        <body>
        <main style={{overflow: isHome ? "hidden" : ""}}>
            <RootLayout isHome={isHome}>
                {children}
            </RootLayout>
        </main>
        </body>
        </html>
    )
}